package com.zyg.javaagent;

import java.util.concurrent.TimeUnit;

public class UserService {

    public void sayHello() throws InterruptedException {
        TimeUnit.SECONDS.sleep(2);
        System.out.println("hello world");
//        long begin = System.currentTimeMillis();
//        sayHello$agent();
//        System.out.println(System.currentTimeMillis()-begin);
    }


    public void print(String name) throws InterruptedException {
//        //模板方法
//        long begin = System.currentTimeMillis();
//        try {
//            % s$agent($$);
//        } finally {
//            long end = System.currentTimeMillis();
//            System.out.println(end - begin);
//        }
        TimeUnit.SECONDS.sleep(1);
        System.out.println(name);
    }


}
